package com.fly.jnetpcap;

import org.jnetpcap.packet.PcapPacket;
import org.jnetpcap.packet.PcapPacketHandler;
import org.jnetpcap.protocol.tcpip.Http;

public class CustomPcapHandler<Object> implements PcapPacketHandler<Object>
{
    private Http http = new Http();
    
    @Override
    public void nextPacket(PcapPacket packet, Object user)
    {
        // 抓取的包协议是Http
        if (packet.hasHeader(http))
        {
            System.out.println(packet);
        }
    }
}
